import java.lang.annotation.*;

/**
 * @author 35326
 * 2021/3/25 15:38
 * 反射的测试代码
 */
@MyAnnotation(s=1)
public class ReflectionTest {
	public static void main(String[] args) {
		Class<ReflectionTest> reflectionTestClass = ReflectionTest.class;
		Annotation[] annotations = reflectionTestClass.getAnnotations();
		for (Annotation annotation : annotations) {
			MyAnnotation myAnnotation = (MyAnnotation) annotation;
			System.out.println(myAnnotation.s());
		}
		Class.forName();
	}
}

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation{
	String value() default "12";
	int s();
}
